package com.sophossystems.client.asmon.dto;


import java.io.Serializable;


public class PrivilegeDTO implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6789557384961396007L;

	/** 
	 * This attribute maps to the column idPrivilege in the Privilege table.
	 */
	protected int idPrivilege;

	/** 
	 * This attribute maps to the column idRole in the Privilege table.
	 */
	protected int idRole;

	/** 
	 * This attribute represents whether the primitive attribute idRole is null.
	 */
	protected boolean idRoleNull = true;

	/** 
	 * This attribute maps to the column idActivity in the Privilege table.
	 */
	protected int idActivity;

	/** 
	 * This attribute represents whether the primitive attribute idActivity is null.
	 */
	protected boolean idActivityNull = true;

	/** 
	 * This attribute maps to the column enabled in the Privilege table.
	 */
	protected int enabled;

	/** 
	 * This attribute represents whether the primitive attribute enabled is null.
	 */
	protected boolean enabledNull = true;

	/**
	 * Method 'Privilege'
	 * 
	 */
	public PrivilegeDTO()
	{
	}

	/**
	 * Method 'getIdPrivilege'
	 * 
	 * @return int
	 */
	public int getIdPrivilege()
	{
		return idPrivilege;
	}

	/**
	 * Method 'setIdPrivilege'
	 * 
	 * @param idPrivilege
	 */
	public void setIdPrivilege(int idPrivilege)
	{
		this.idPrivilege = idPrivilege;
	}

	/**
	 * Method 'getIdRole'
	 * 
	 * @return int
	 */
	public int getIdRole()
	{
		return idRole;
	}

	/**
	 * Method 'setIdRole'
	 * 
	 * @param idRole
	 */
	public void setIdRole(int idRole)
	{
		this.idRole = idRole;
		this.idRoleNull = false;
	}

	/**
	 * Method 'setIdRoleNull'
	 * 
	 * @param value
	 */
	public void setIdRoleNull(boolean value)
	{
		this.idRoleNull = value;
	}

	/**
	 * Method 'isIdRoleNull'
	 * 
	 * @return boolean
	 */
	public boolean isIdRoleNull()
	{
		return idRoleNull;
	}

	/**
	 * Method 'getIdActivity'
	 * 
	 * @return int
	 */
	public int getIdActivity()
	{
		return idActivity;
	}

	/**
	 * Method 'setIdActivity'
	 * 
	 * @param idActivity
	 */
	public void setIdActivity(int idActivity)
	{
		this.idActivity = idActivity;
		this.idActivityNull = false;
	}

	/**
	 * Method 'setIdActivityNull'
	 * 
	 * @param value
	 */
	public void setIdActivityNull(boolean value)
	{
		this.idActivityNull = value;
	}

	/**
	 * Method 'isIdActivityNull'
	 * 
	 * @return boolean
	 */
	public boolean isIdActivityNull()
	{
		return idActivityNull;
	}

	/**
	 * Method 'getEnabled'
	 * 
	 * @return int
	 */
	public int getEnabled()
	{
		return enabled;
	}

	/**
	 * Method 'setEnabled'
	 * 
	 * @param enabled
	 */
	public void setEnabled(int enabled)
	{
		this.enabled = enabled;
		this.enabledNull = false;
	}

	/**
	 * Method 'setEnabledNull'
	 * 
	 * @param value
	 */
	public void setEnabledNull(boolean value)
	{
		this.enabledNull = value;
	}

	/**
	 * Method 'isEnabledNull'
	 * 
	 * @return boolean
	 */
	public boolean isEnabledNull()
	{
		return enabledNull;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	@Override
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof PrivilegeDTO)) {
			return false;
		}
		
		final PrivilegeDTO _cast = (PrivilegeDTO) _other;
		if (idPrivilege != _cast.idPrivilege) {
			return false;
		}
		
		if (idRole != _cast.idRole) {
			return false;
		}
		
		if (idRoleNull != _cast.idRoleNull) {
			return false;
		}
		
		if (idActivity != _cast.idActivity) {
			return false;
		}
		
		if (idActivityNull != _cast.idActivityNull) {
			return false;
		}
		
		if (enabled != _cast.enabled) {
			return false;
		}
		
		if (enabledNull != _cast.enabledNull) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	@Override
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + idPrivilege;
		_hashCode = 29 * _hashCode + idRole;
		_hashCode = 29 * _hashCode + (idRoleNull ? 1 : 0);
		_hashCode = 29 * _hashCode + idActivity;
		_hashCode = 29 * _hashCode + (idActivityNull ? 1 : 0);
		_hashCode = 29 * _hashCode + enabled;
		_hashCode = 29 * _hashCode + (enabledNull ? 1 : 0);
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return PrivilegePk
	 */
	public PrivilegePkDTO createPk()
	{
		return new PrivilegePkDTO(idPrivilege);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	@Override
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.sophossystems.client.asmon.dto.Privilege: " );
		ret.append( "idPrivilege=" + idPrivilege );
		ret.append( ", idRole=" + idRole );
		ret.append( ", idActivity=" + idActivity );
		ret.append( ", enabled=" + enabled );
		return ret.toString();
	}

}
